//
//  ViewController.m
//  Runloop流程
//
//  Created by 崔博 on 2018/8/21.
//  Copyright © 2018年 崔博. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
//    dispatch_async(dispatch_get_global_queue(0, 0), ^{
//        // 处理子线程逻辑
//
//        // 回到主线程刷新UI
//        dispatch_async(dispatch_get_main_queue(), ^{
//            NSLog(@"1111");
//        });
//    });
    static int a = 0;
    NSTimer * time = [NSTimer timerWithTimeInterval:1.0 repeats:YES block:^(NSTimer * _Nonnull timer) {
        NSLog(@"%ld",a++);
    }];
    [[NSRunLoop currentRunLoop] addTimer:time forMode: UITrackingRunLoopMode];
}

- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
{
 
}
@end
